package com.bupt.ilink.entity.pojo.store;

import com.bupt.ilink.entity.store.StoreFlow;
import com.fasterxml.jackson.databind.JsonNode;
import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class DownloadFlowResult {
    private String flowId;
    private String flowName;
    private String description;
    private JsonNode data;
    private Boolean component;
    private JsonNode metaData;

    public static DownloadFlowResult from(StoreFlow storeFlow)  {
        return new DownloadFlowResult(
                storeFlow.getFlowId(),
                storeFlow.getFlowName(),
                storeFlow.getDescription(),
                storeFlow.getData(),
                storeFlow.getComponent(),
                storeFlow.getMetaData()
        );
    }

}
